import { PageReq } from "@/typings/api";
import { User, CreateUserReq, UpdateUserReq } from "@/typings/api/user";
import { request } from "@/utils/request";

export const getUserList = (params: PageReq<User>) => request.get("/user", { params });
export const getUserRecord = (_id: string) => request.get(`/user/${_id}`);
export const createUser = (data: CreateUserReq) => request.post("/user", data);
export const updateUser = (data: UpdateUserReq) => request.put("/user", data);
export const deleteUser = (_id: string) => request.delete("/user", { data: { _id } });